<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<pre>
from functools import wraps
from datetime import datetime


def log_it(logfile='out.log'):
    def logging_decorator(func):
        @wraps(func)
        def wrapped_function(*args, **kwargs):
            log = f"[{datetime.now()}]{func.__name__} was called"
            with open(logfile, 'a')as fd:
                fd.write(log + '\n')
            return func(*args, **kwargs)
        return wrapped_function
    return logging_decorator


@log_it()
def func1():
    pass


@log_it(logfile='func2.log')
def func2():
    pass


func1()
func2()

</pre>
</body>
</html>